package com.mini.admin.api.openfeign;

import com.mini.admin.api.entity.SysUser;
import com.mini.common.core.result.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 提供外部feign调用 User 的相关操作
 * @author Zhou Feng
 */
@FeignClient(value = "mini-admin", path = "/open/user", contextId = "admin-user-client")
public interface AdminUserOpen {
    /**
     * 根据username获取 user，
     */
    @GetMapping("/getByUsername")
    RestResponse<SysUser> getUserByUsername(@RequestParam("username") String username);

    /**
     * 根据 mobile 获取 user
     */
    @GetMapping("/getByMobile")
    RestResponse<SysUser> getUserByMobile(@RequestParam("mobile") String mobile);
}
